def extract_attributes(element: str):
    attr_vals = []
    index_of_right = element.index('>')
    index_of_first_space = element.find(' ')
    if index_of_first_space < 0 or index_of_first_space > index_of_right:
        return attr_vals
    open_tag = element[index_of_first_space+1:index_of_right].rstrip(' /')
    props = open_tag.split('" ')
    for prop in props:
        attr, val = prop.split('=')
        val = val.strip('"')
        attr_vals.append(f"{attr}, {val}")
    return attr_vals


if __name__ == '__main__':
    # print(extract_attributes('<span class="red"></span>'))
    print(extract_attributes('<button id="submit" class="btn btn-primary">Submit</button>'))